package main

import (
	"fmt"
	"time"
)

//goroutine
//多线程-每个线程占用的内存比较多而且系统切换开销很大，上千 绿程/轻量级线程–协程
func main() {
	for i := 0; i < 1000000; i++ {
		go func(n int) {
			for {
				fmt.Println(n)
				time.Sleep(time.Second)
			}
		}(i)
	}
	time.Sleep(time.Second * 30)
}
